#ifndef PICTUREPUZZLEITEM_H
#define PICTUREPUZZLEITEM_H

#include <QPixmap>
#include <QWidget>

class PicturePuzzleItem : QWidget
{
public:
    PicturePuzzleItem(QWidget* p, int mapSize);
    bool isRight();
    void init(QPixmap* p, int num);
    void setCurPos(int num);
    void updata();
    int getIndex() const {return m_mapSize * m_curPosX + m_curPosY;}
    QPixmap* getPixmap() const {return m_pixmap;}

    //void mousePressEvent(QMouseEvent *event) override;

    int m_curPosX = 0;
    int m_curPosY = 0;

private:
    int m_targetPosX = 0;
    int m_targetPosY = 0;
    QPixmap* m_pixmap;
    int m_mapSize = 0;
};

#endif // PICTUREPUZZLEITEM_H
